package com.uyayo.core.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * 
 * <p>
 * Title: BaseController
 * </p>
 * <p>
 * Description:基础的controller
 * </p>
 * <p>
 * Company: www.lelekeji.com
 * </p>
 * 
 * @author 乐乐科技.胡逢君
 * @date 2015-4-13下午4:03:35
 * @version 1.0
 */
@Controller
@RequestMapping()
public class BaseController{

	/**
	 * 错误页面 
	 */
	@RequestMapping(value="/errors/{type}",method=RequestMethod.GET)
	public ModelAndView error(ModelAndView modelAndView,@PathVariable("type") String type){
		modelAndView.setViewName(type);
		return modelAndView;
	}
	
	/**
	 * 成功页面
	 */
	@RequestMapping(value="/success/{type}",method=RequestMethod.GET)
	public ModelAndView success(ModelAndView modelAndView,@PathVariable("type") String type){
		modelAndView.setViewName(type);
		return modelAndView;
	}
	
}


